﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HouodeFun.TrainCenter.IDAL;

namespace HouodeFun.TrainCenter.IBLL
{
    public interface IBaseService<T> where T:class,new()
    {
        IDbSessionFactory DbSessionFactory { get; set; }
        IDbSession DbSessionContext {get;set;}
        T AddEntity(T entity);
        bool DeleteEntity(T entity);
        int DeleteBy(System.Linq.Expressions.Expression<Func<T, bool>> whereLambda);
        T UpdateEntity(T entity);

        IQueryable<T> LoadEntities(System.Linq.Expressions.Expression<Func<T,bool>> whereLambda);
        IQueryable<T> LoadPageEntities<S>(System.Linq.Expressions.Expression<Func<T, bool>> whereLambda,System.Linq.Expressions.Expression<Func<T,S>> orderBy,int pageIndex,int pageSize,out int totalCount,bool isAsc);
    }
}
